import { BasicStatus, PermissionType } from '#/enum';
import type { BasicStatusType, PermissionTypeType } from '#/enum';

export interface UserToken {
    accessToken?: string;
    refreshToken?: string;
}

export interface UserInfo {
    user_id: string;
    name: string;
    last_login: string | null;
    create_time: string;
    token: string;
    permissions?: Permission[];
}

export interface Organization {
    id: string;
    name: string;
    status: 'enable' | 'disable';
    desc?: string;
    order?: number;
    children?: Organization[];
}

export interface Permission {
    id: string;
    parent_id: string;
    name: string;
    label?: string;
    leaf: number;
    permissions_type: PermissionTypeType;
    path: string;
    status?: BasicStatusType;
    sort?: number;
    icon?: string;
    component?: string;
    hide?: boolean;
    frameSrc?: string;
    newFeature?: boolean;
    children?: Permission[];
    redirect?: string;
}

export interface Role {
    id: string;
    name: string;
    label: string;
    status: BasicStatusType;
    order?: number;
    desc?: string;
    permission?: Permission[];
}
